using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class StartScene : MonoBehaviour
{
    public Button startButton;
    public Button continueButton;
    public Button settingButton;
    public Button quitButton;
    private SaveManager saveManager;
    private GameObject settingPanel;

    // Start is called before the first frame update
    void Start()
    {
        startButton.onClick.AddListener(OnClickStart);
        continueButton.onClick.AddListener(OnClickContinue);
        settingButton.onClick.AddListener(OnClickSetting);
        quitButton.onClick.AddListener(OnClickQuit);
        saveManager = SaveManager.Instance;
        settingPanel = Instantiate(Resources.Load<GameObject>("Prefabs/UI/SettingUI"), this.transform);
        settingPanel.SetActive(false);
    }

    void OnClickStart()
    {
        GameManager.Instance.LoadScene("TestScene");
        AudioManager.Instance.PlaySound((int)E_SoundType.Click);
    }

    void OnClickContinue()
    {
        AudioManager.Instance.PlaySound((int)E_SoundType.Click);
    }

    void OnClickSetting()
    {
        settingPanel.SetActive(true);
        AudioManager.Instance.PlaySound((int)E_SoundType.Click);
    }

    void OnClickQuit()
    {
        AudioManager.Instance.PlaySound((int)E_SoundType.Click);
        Application.Quit();
    }


}
